(deftemplate Animal
    (slot nume)
    (slot nutrimente) 
    (slot modViata) 
    (slot mediu)
    (slot reproducere)
    (slot caracteristici)
    (slot regim)
    (slot zona)
    )

(assert(Animal(nume Capra)(nutrimente iarba)(modViata diurn)(mediu terestru)(reproducere pui)(caracteristici blana)(regim vegetarian)))

(assert(Animal(nume Leu)(nutrimente carne)(modViata diurn)(mediu terestru)(reproducere pui)(caracteristici blana)(regim carnivor)))

(assert(Animal(nume Piranha)(nutrimente carne)(modViata diurn)(mediu acvatic)(reproducere oua)(caracteristici solzi)(regim carnivor)))

(assert(Animal(nume Tigru)(nutrimente carne)(modViata diurn)(mediu terestru)(reproducere pui)(caracteristici blana)(regim carnivor)))

(assert(Animal(nume Liliac)(nutrimente sange)(modViata nocturn)(mediu aerian)(reproducere oua)(caracteristici canini)(regim carnivor)))

(assert(Animal(nume Ras)(nutrimente carne)(modViata diurn)(mediu terestru)(reproducere pui)(caracteristici blana)(regim carnivor)))

(assert(Animal(nume Vaca)(nutrimente iarba)(modViata diurn)(mediu terestru)(reproducere pui)(caracteristici blana)(regim vegetarian)))

(facts)



(defrule regula1
    (Animal(nume ?x)(mediu acvatic))
    =>
    
     (printout t "Animalul " ?x  " traieste in mediul de viata acvatic" crlf)
    )


(run)

(defrule regula2
    (Animal(nume ?x)(zona mediteraneana)(regim vegetarian))
    =>
   
     (printout t "Animalul " ?x  " are regim alimentar vegetarian" crlf)
    )
(run)


(defrule regula3
     (Animal(nume ?y)(regim carnivor))
     (Animal(nume ?x)(regim vegetarian))
    =>
     (printout t " ( " ?y " , " ?x " ) " crlf)
    )


(run)
(agenda)
